Added server extensibility interface #1640
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The MQTT protocol is used almost unanimously for connecting IoT devices. In many cases the messages being sent in either direction (cloud-to-device or device-to-cloud) are routed to topics which include the client id or some other form of individual device identifier. In many cases, messages are routed in exclusively this manner.
The nature of most clustered MQTT brokers is to replicate messages across all nodes so every connected client has the ability to receive the message for that topic if they are subscribed to it. Including the ability for developers to inject messages on topics directed to specific clients has the advantage of increasing performance when scanning the list of sessions/clients to relay messages to.
Leveraging the combination of these changes and cancelling ProcessPublish during the InterceptingPublishAsync method, users of this library can customize the routes of their messages to go directly to the individual client they intended.
In load balanced / clustered scenarios with millions of connected devices, this has a massive advantage.